package com.vf.admin.client.service.impl;

import com.vf.admin.client.dao.AppCommentDianzanDao;
import com.vf.admin.client.service.AppCommentDianzanService;
import com.vf.admin.miaodong.entity.AppCommentDianzan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class AppCommentDianzanServiceImpl implements AppCommentDianzanService {

    @Autowired
    AppCommentDianzanDao appCommentDianzanDao;

    @Override
    public void save(AppCommentDianzan appDynamic) {
        appCommentDianzanDao.save(appDynamic);
    }

    @Override
    public void commentDianzanSave(Integer commentid,String nick,String pic,String phone,Integer userid) {
        AppCommentDianzan dianzans = new AppCommentDianzan();
        dianzans.setCreatetime(new Date());
        dianzans.setCommentid(commentid);
        dianzans.setNick(nick);
        dianzans.setPic(pic);
        dianzans.setPhone(phone);
        dianzans.setUserid(userid);
        appCommentDianzanDao.save(dianzans);
    }

    @Override
    public AppCommentDianzan get(Integer id) {
        return appCommentDianzanDao.get(id);
    }

    @Override
    public AppCommentDianzan getSpecifiedLike(Integer userid,Integer dynamicid) {
        return appCommentDianzanDao.getSpecifiedLike(userid, dynamicid);
    }

    @Override
    public List<AppCommentDianzan> getByCommentId(Integer commentId) {
        return appCommentDianzanDao.getByCommentId(commentId);
    }


    @Override
    public void del(Integer id) {
        appCommentDianzanDao.del(id);
    }
}
